package com.geekchique.runningbuddy.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.Menu.Item;
import android.widget.Button;

import com.geekchique.runningbuddy.R;
import com.geekchique.runningbuddy.controller.HomeControllerImpl;
import com.geekchique.runningbuddy.controller.IHomeController;
import com.geekchique.runningbuddy.controller.IOptionsMenu;
import com.geekchique.runningbuddy.controller.OptionsMenuImpl;

public class Home extends Activity {
    
	private IHomeController homeController;
	private IOptionsMenu optionsMenu;
	
	@Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.home);
		optionsMenu = new OptionsMenuImpl(this);
		
        homeController = new HomeControllerImpl(this);
        
        homeController.createHomeView(
        		this,
        		(Button)findViewById(R.id.goto_stopclock),
        		(Button)findViewById(R.id.goto_today),
        		(Button)findViewById(R.id.goto_journal),
        		(Button)findViewById(R.id.goto_help),        
        		(Button)findViewById(R.id.goto_map)        
        );
        
    }
	
    @Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		optionsMenu.addAllActivitiesToMenu(menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(Item item) {
		optionsMenu.selectItem(item);
	    return super.onOptionsItemSelected(item);
	}


    
}